package com.wc.AlgoOJ_homework.AlgoOJ_BL4.J_积木画;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/4/6 10:04
 * @description http://43.138.190.70:8888/p/LQ1316?tid=660a4f84d7ba43eb2f4c549d
 */
public class Main {
    static int N = (int) 1e7 + 10;
    // 刚刚好平展
    static long[] a = new long[N];
    // 上突出
    static long[] b = new long[N];
    // 下突出
    static long[] c = new long[N];
    static int n;
    static int P = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        a[1] = 1;
        a[0] = 1;
        for (int i = 2; i <= n; i++) {
            a[i] = (a[i - 1] + a[i - 2] + b[i - 1] + c[i - 1]) % P;
            b[i] = (c[i - 1] + a[i - 2]) % P;
            c[i] = (b[i - 1] + a[i - 2]) % P;
        }
        System.out.println(a[n]);
    }
}
